/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is Forte for Java, Community Edition. The Initial * Developer of the Original Code is Sun Microsystems, Inc. Portions * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.debugger.support; import org.openide.util.NbBundle; /** * Customizer of LineBreakpointEvent. * * @author Jan Jancura */ class LineBreakpointPanel extends javax.swing.JPanel { private LineBreakpointEvent event; static final long serialVersionUID =-8164649328980808272L; /** Creates new form LineBreakpointPanel */ public LineBreakpointPanel (LineBreakpointEvent e) { event = e; initComponents (); jTextField1.setText (e.getClassName ()); jTextField2.setText ("" + (e.getLineNumber () < 0 ? "" : ("" + e.getLineNumber ()))); // NOI18N } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. */ private void initComponents () {//GEN-BEGIN:initComponents jLabel1 = new javax.swing.JLabel (); jTextField1 = new javax.swing.JTextField (); jLabel2 = new javax.swing.JLabel (); jTextField2 = new javax.swing.JTextField (); jPanel1 = new javax.swing.JPanel (); setLayout (new java.awt.GridBagLayout ()); java.awt.GridBagConstraints gridBagConstraints1; jLabel1.setText (NbBundle.getBundle (LineBreakpointPanel.class).getString ("CTL_Class_name")); gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 0; gridBagConstraints1.insets = new java.awt.Insets (2, 2, 2, 2); add (jLabel1, gridBagConstraints1); jTextField1.setColumns (25); jTextField1.addFocusListener (new java.awt.event.FocusAdapter () { public void focusLost (java.awt.event.FocusEvent evt) { jTextField1FocusLost (evt); } } ); gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.gridx = 1; gridBagConstraints1.gridy = 0; gridBagConstraints1.gridwidth = 0; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.insets = new java.awt.Insets (2, 2, 2, 2); gridBagConstraints1.weightx = 1.0; add (jTextField1, gridBagConstraints1); jLabel2.setText (NbBundle.getBundle (LineBreakpointPanel.class).getString ("CTL_Line_number")); gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 1; gridBagConstraints1.insets = new java.awt.Insets (2, 2, 2, 2); add (jLabel2, gridBagConstraints1); jTextField2.setColumns (25); jTextField2.addFocusListener (new java.awt.event.FocusAdapter () { public void focusLost (java.awt.event.FocusEvent evt) { jTextField2FocusLost (evt); } } ); gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.gridx = 1; gridBagConstraints1.gridy = 1; gridBagConstraints1.gridwidth = 0; gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.insets = new java.awt.Insets (2, 2, 2, 2); gridBagConstraints1.weightx = 1.0; add (jTextField2, gridBagConstraints1); gridBagConstraints1 = new java.awt.GridBagConstraints (); gridBagConstraints1.gridx = 2; gridBagConstraints1.gridy = 2; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add (jPanel1, gridBagConstraints1); }//GEN-END:initComponents private void jTextField1FocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField1FocusLost // Add your handling code here: event.setClassName (jTextField1.getText ()); }//GEN-LAST:event_jTextField1FocusLost private void jTextField2FocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField2FocusLost // Add your handling code here: try { int i = Integer.parseInt (jTextField2.getText ()); event.setLineNumber (i); } catch (NumberFormatException e) { jTextField2.setText ("-1"); // NOI18N } }//GEN-LAST:event_jTextField2FocusLost // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; private javax.swing.JTextField jTextField1; private javax.swing.JLabel jLabel2; private javax.swing.JTextField jTextField2; private javax.swing.JPanel jPanel1; // End of variables declaration//GEN-END:variables } /* * Log * 10 Gandalf 1.9 1/13/00 Daniel Prusa NOI18N * 9 Gandalf 1.8 11/5/99 Jan Jancura Add Breakpoint Dialog * design updated * 8 Gandalf 1.7 10/23/99 Ian Formanek NO SEMANTIC CHANGE - Sun * Microsystems Copyright in File Comment * 7 Gandalf 1.6 9/28/99 Jan Jancura * 6 Gandalf 1.5 8/18/99 Jan Jancura Localization & Current * thread & Current session * 5 Gandalf 1.4 8/9/99 Ian Formanek Generated Serial Version * UID * 4 Gandalf 1.3 8/3/99 Jan Jancura bUG 3086 * 3 Gandalf 1.2 7/21/99 Jan Jancura * 2 Gandalf 1.1 7/14/99 Jan Jancura * 1 Gandalf 1.0 7/13/99 Jan Jancura * $ */